<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>RBAC - 登录</title>
    <meta name="keywords" content="SEO H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link href="static/css/bootstrap.min.css" rel="stylesheet">
    <link href="static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="static/css/animate.css" rel="stylesheet">
    <link href="static/css/style.css" rel="stylesheet">
    <link href="static/css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[ H+ ]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>RBAC权限管理系统</strong></h4>
                    <ul class="m-b">
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势一</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势二</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势三</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势四</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势五</li>
                    </ul>
                    <strong>还没有账号？ <a href="#">立即注册&raquo;</a></strong>
                </div>
            </div>
            <div class="col-sm-5">
                <form method="post" id="loginForm">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到RBAC权限管理系统</p>
                    <input type="text" id="loginAccount" value="admin" name="loginAccount" class="form-control uname" placeholder="用户名" />
                    <input type="password" id="loginPwd" value="admin" name="loginPwd" class="form-control pword" placeholder="密码" />
                    <div class="input-group m-t m-b">
                        <input type="text" name="code" value="12312" id="code1" class="form-control no-margins" style="color: black" placeholder="验证码">
                        <span class="input-group-addon no-padding"><img src="verification" height="32" id="code"></span>
                    </div>
                    <a href="">忘记密码了？</a>
                    <button class="btn btn-success btn-block" id="login" type="button">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 2015 All Rights Reserved. H+
            </div>
        </div>
    </div>
<div id="load" style="display:none;z-index: 100;width:100%;height: 100%" >正在加载....</div>
</body>
<script src="static/js/jquery.min.js"></script>
<script src="static/js/plugins/layer/layer.min.js"></script>
<script src="static/js/plugins/validate/jquery.validate.min.js"></script>
<script src="static/js/plugins/validate/messages_zh.min.js"></script>
<script src="static/sofwin.js"></script>
<script src="static/js/plugins/jquery-ui/jquery.blockUI.js"></script>
<script>
    var icon = "<i class='fa fa-times-circle'></i>  ";
    $(function () {

        $("#loginForm").validate({
           rules:{
               loginAccount:"required",
               loginPwd:"required"
           },
            messages:{
               loginAccount:icon+"用户名不能为空",
                loginPwd:icon+"密码不能为空"
            }
        });
        $("#login").click(function(){
            if(!$("#loginForm").valid()){
                return;
            }
            let params = $("#loginForm").serialize();
            $.operator.post('login',params,function(ret){
                alert(ret.message);
                if(ret.code==200) {
                    document.location.href = "index";
                }
            })
        })
        $("#code").click(function () {
            $(this).attr("src","verification?t="+new Date());
        })
    })
</script>
</html>
